import '../repository/cache_repository.dart';
import 'usecase.dart';

class GetCacheUseCase implements UseCase<Future<String>, String> {
  final CacheRepository _repository;

  GetCacheUseCase(this._repository);
  @override
  Future<String> call(String params) => _repository.get(params);
}

class SetCacheUseCase extends UseCase<void, SetCacheParams> {
  final CacheRepository _repository;

  SetCacheUseCase(this._repository);
  @override
  Future<void> call(SetCacheParams params) async {
    await _repository.set(params.key, params.value);
  }
}

class SetCacheParams {
  final String key;
  final String value;

  SetCacheParams(this.key, this.value);
}
